<?php
 use think\facade\Route;

 function AdminRoute(){

     Route::get('/', 'Auth/index');


     Route::post('admin/auth/login', 'Auth/login');
     Route::post('admin/auth/register', 'Auth/register');

     // 登录信息
     Route::group('admin/auth', function () {
         Route::get('/logout', 'logout');
         Route::get('/unregister', 'unregister');
     })->prefix('Auth/')->middleware('AuthLogin');

     // 个人信息
     // group第一个参数控制路由前缀，  prefix是同一个控制器的前缀
     Route::group('home/auth', function () {
         Route::post('/about', 'about');
         Route::post('/update', 'update');
     })->prefix('Users/')->middleware('AuthLogin');

     // 用户管理
     Route::group('admin/auth', function () {
         Route::post('/searchAll', 'searchAll');
         Route::post('/searchDelAll', 'searchDelAll');
         Route::post('/searchUseAll', 'searchUseAll');
         Route::get('/search', 'search');
     })->prefix('UserManage/')->middleware('AuthLogin');


 }